<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // JS中判断数组的方法

        let array = [];

        // 通过Object.prototype.toString.call()做判断
        console.log(Object.prototype.toString.call(array));

        // 通过原型链
        console.log(array.__proto__ == Array.prototype);

        // 通过ES6的Array.isArray()
        console.log(Array.isArray(array));

        // 通过instanceof
        console.log(array instanceof Array);

        // 通过Array.prototype.isPrototypeOf做判断
        console.log(Array.prototype.isPrototypeOf(array));
    </script>
</body>
</html>